<template>
    <div class="root">
      <Navbar class="navbar" @click="handleClick" />  
      <!-- @click="handleClick"透传到navbar上 ,和属性一样APP.vue上的handleClick跟Navbar.vue上的handleClick会合并。-->
      <Layout class="layout" :myShow="isShow"/>
     
    </div>
  </template>
  
  <script>
  import Navbar from './components/Navbar.vue'
  import Layout from './components/Layout.vue'
  
  export default {
    data(){
        return {
            isShow: true
        }
    },
    
    methods: {
      handleClick(){
        console.log('Appclick');
        this.isShow = !this.isShow
      }
    },
    components: {
      Navbar,
      Layout
    }
  }
  </script>
  
  
  <style>
  *{
    padding: 0;
    margin: 0;
  }
  
  .root{
    display: flex;
    flex-direction: column;
    height: 100vh;
  }
  
  .navbar{
    height: 50px;
  }
  
  .layout{
    flex: 1;
    display: flex;
  }
  
  body{
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #2c3e50;
  }
  </style>